#ifndef _ASPRITE_H_
#define _ASPRITE_H_

#include <stdarg.h>
#include "utypes.h"
#include "sprite.h"
#include "video.h"
#include "pixmap.h"



/** @defgroup animsprite AnimSprite
 * @{
 *
 * Animated Sprite related functions
 */

/** An Animated Sprite is a "sub-classing" of Sprites
 *  where each Sprite is manipulated using Sprite functions
 */
typedef struct {
	Sprite *sp;		///< pointer to first Sprite, the one with overall properties
	int aspeed;		///< animation speed 
	int cur_aspeed; ///< current animation speed 
	int num_fig; 	///< number of pixmaps 
	int cur_fig; 	///< current pixmap 
	char **map;     ///< pointer to array of each AnimSprite pixmaps
} AnimSprite;

/** Create an Animated Sprite from multiple pixmaps
 * At least one pixmap must be specified.
 */
AnimSprite * create_asprite(char *pic1[], ...);

/** Shrinks a waterlily till drowning in the lake,
 * appearing a splash after drowning.
 */
int shrink_waterlily(AnimSprite *fig, char *base);


/** Draws in random positions and of random sizes waterlilies,
 * whose address is "base", according to the current game level. If the 
 * level increases, the waterlilies appear faster, but also start 
 * shrinking faster, thus having a certain speed.
 */
void draw_shrinking_waterlilies(int speed, char *base);



/** Destroy an Animated Sprite from video memory and
* release all resources allocated.
*/
void destroy_asprite(AnimSprite *fig, char *base);

/** @} end of sprite */

#endif
